<template>
  <view class="orderList">
    <view class="list " @click="getDetail(dataInfo.id)">
      <view class="shopList">
        <view class="shopItem flex flex-bt">
          <view class="left flex">
            <image :src="getImgUrl(dataInfo.goods_cover)"  mode="scaleToFill" />
            <view class="flex flex-direction flex-bt">
              <view>
                <view class="name one-omit">{{dataInfo.goods_name}}</view>
                <view class="miaoshu one-omit">{{dataInfo.remark}}</view>
              </view>
              <view class="flex flex-align flex-bt">
                <view class="text">
                  <view v-if='dataInfo.coinid==1'>￥</view>{{dataInfo.price_selling}}
                  <view v-if='dataInfo.coinid!=1'>{{dataInfo.coinname}}</view>
                </view>
                <view class="btns">{{dataInfo.coinid==1?'购买':'兑换'}}</view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import { getTime, menuJump,getImgUrl } from '@/utils/tools'
import { onMounted, reactive, ref } from 'vue'
const timeCount = ref(3000)
const timeInfo = ref<Object>({
  testHour:0,
  testMinute:0,
  testSecond:0
})
onMounted(() => {
  timeInfo.value = getTime(timeCount)
})
defineProps({
  title: {
    type: String,
    default: ''
  },
  type: {
    type: Number,
    default: 0
  },
  dataPeizhi: {
    type: Object,
    default: () => ({}) 
  },
  dataInfo: {
    type: Object,
    default: () => ({}) 
  }
})
const emit = defineEmits(['submit', 'update:show'])


onMounted(() => {})
async function open() {
  updateShow(true)
}
function getDetail(e: any) {
  menuJump({is_tab: false,link: '/pages/shop/detail?idcode='+e,link_type: 1})
}

function updateShow(value: boolean) {
  emit('update:show', value)
}
defineExpose({
  open
})
</script>

<style lang="scss" scoped>
.orderList{
  .list{
    .shopList{margin-bottom: 30rpx;
      .shopItem{
        .left{
          image{width: 170rpx;height: 170rpx;border-radius: 10rpx;}
          .flex-direction{margin-left: 20rpx;
            .miaoshu{color: #969799;margin-top: 10rpx;font-size: 24rpx;width: 440rpx;}
            .name{font-size: 28rpx;color: #333;width: 440rpx;font-weight: bold;}
            .text{font-size: 32rpx;color: #FE4927;margin-top: 10rpx;
              view{display: inline-block;font-size: 24rpx;}
            }
           .btns{background: linear-gradient(to right,#E86A5B,#FFAF98);color: #fff;border-radius: 30rpx;font-size: 24rpx;padding: 15rpx 40rpx;}
          }
        }
      }
    }
   
  }
}

</style>
